package icu.javayanglei.config

import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
import org.springframework.boot.web.server.WebServerFactoryCustomizer
import org.springframework.context.annotation.Configuration

@Configuration
class WebConfig : WebServerFactoryCustomizer<TomcatServletWebServerFactory> {
    override fun customize(factory: TomcatServletWebServerFactory?) {

        val mimeMappings = factory?.mimeMappings

        mimeMappings?.add("mjs", "application/javascript")

        factory?.mimeMappings = mimeMappings
    }


}
